#pragma once

#include <Windows.h>
#include <gl\GL.h>
#include <gl\GLU.h>

#include <opencv\cv.h>

#include "RenderSystem.h"
#include "BallGame.h"

#include "Marker.h"

namespace TUMAR { namespace Snowman
{
	class VirtualObjectRenderer : public AbstractRenderer
	{
	private:
		const double nearPlane;
		const double farPlane;
		
		float angle;
		float scale;
		float scaleFactor;
		
		bool fromFirstToSecond;

		MarkerContainer markers;
		
		BallGame game;

		void TransposeMatrix(const float* input, float* output);

		void FaceAt(const Marker& marker, const Marker& target);
		void FaceAt2(const Marker& marker, const Marker& target);

		void DrawBall(void);
		void DrawSnowman(double red);
	public:
		VirtualObjectRenderer(void);
		virtual ~VirtualObjectRenderer(void);

		void OnMarkersFound(const MarkerContainer& markers);

		virtual void Render(void);
	};
}}

